SpreadsheetGear 2017
WithLock<TResult>(Func<TResult>) Method






SpreadsheetGear.Windows.Forms Namespace > WorkbookView Class > WithLock Method : WithLock<TResult>(Func<TResult>) Method
The type of the result returned by 'func'.
The function to run.
Calls GetLock(), runs the specified Func, calls ReleaseLock() and then returns the value returned by the Func.
Syntax
'Declaration
 
Public Overloads Function WithLock(Of TResult)( _
   ByVal func As System.Func(Of TResult) _
) As TResult
'Usage
 
Dim instance As WorkbookView
Dim func As System.Func(Of TResult)
Dim value As TResult
 
value = instance.WithLock(Of TResult)(func)
public TResult WithLock<TResult>( 
   System.Func<TResult> func
)
public function WithLock( 
    func: System.Func
): TResult; 
public function WithLock( 
   func : System.Func
) : TResult;
public: TResult* WithLock<TResult>( 
   System.Func<TResult*>* func
) 
public:
TResult^ WithLockgeneric<typename TResult>
( 
   System.Func<TResult^>^ func
) 

Parameters

func
The function to run.

Type Parameters

TResult
The type of the result returned by 'func'.

Return Value

The value returned by 'func'.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

WorkbookView Class
WorkbookView Members
Overload List
WithLock(Action) Method
GetLock Method
ReleaseLock Method